﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace AppManager.DomainModel
{
    //如果有些屬性不想要驗證的話，可以使用ModelState.Remove("Id")這種形式來移除驗證
    //只有string類型默認是可以為空的
    //Id ,DateTime都是必須不能是默認值，比如int!=0,dateTime!=DateTime.MinValue
    //這種驗證搞的好奇葩啊
    public class AppInfoModel
    {
        public int Id { get; set; }
        public string AppLogo { get; set; }

        [Required]
        public string Identity { get; set; }

        [Required]
        public string Name { get; set; }

        public string PassWord { get; set; }

        /// <summary>
        ///     下载地址
        /// </summary>
        public string AndroidUrl { get; set; }

        public string IosUrl { get; set; }

        /// <summary>
        ///     测试文件地址(保存着文件的相对位置)
        /// </summary>
        public string AndroidTestUrl { get; set; }

        public string IosTestUrl { get; set; }

        /// <summary>
        ///     版本
        /// </summary>
        public string AndroidVersion { get; set; }

        public string IosVersion { get; set; }

        /// <summary>
        ///     发布时间
        /// </summary>
        public DateTime AndroidPushDate { get; set; }

        public DateTime IosPushDate { get; set; }

        /// <summary>
        ///     app大小
        /// </summary>
        public string AndroidAppSize { get; set; }

        public string IosAppSize { get; set; }

        /// <summary>
        ///     app簡介
        /// </summary>
        [AllowHtml]
        public string AndroidDescription { get; set; }

        [AllowHtml]
        public string IosDescription { get; set; }

        /// <summary>
        ///     更新描述
        /// </summary>
        [AllowHtml]
        public string AndroidUpdatedExplain { get; set; }

        [AllowHtml]
        public string IosUpdatedExplain { get; set; }
        public string AndroidSchemalUrl { get; set; }
        public string IosSchemalUrl { get; set; }
    }
}